﻿// Study0313.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 第三章 函数 含默认值的函数

#include <iostream>;
using namespace std;


int getVolume(int length, int width=2, int height=3);

int main()
{
	const int X = 10, Y = 12, Z = 15;
	cout << "Some box data is ";
	cout << getVolume(X, Y, Z) << endl;
	cout << "Some box data is ";
	cout << getVolume(X, Y) << endl;
	cout << "Some box data is ";
	cout << getVolume(X) << endl;
	return 0;
}

int getVolume(int length, int width, int height)
{
	cout.width(5);
	cout << length;
	cout.width(5);
	cout << width;
	cout.width(5);
	cout << height<<"\t";
	return length * width * height;
}

